#ifndef  __IIC_H_
#define  __IIC_H_

#include <at32f4xx.h>
#ifndef uchar
#define uchar unsigned char
#endif

#ifndef uint 
#define uint unsigned int
#endif

#define PORT_I2C_SCL              GPIOB
#define PORT_I2C_SDA              GPIOB

#define PIN_I2C_SCL               GPIO_Pins_6
#define PIN_I2C_SDA               GPIO_Pins_7

#define I2C_SCL_LOW               (PORT_I2C_SCL->BRE  = PIN_I2C_SCL)
#define I2C_SCL_HIGH              (PORT_I2C_SCL->BSRE = PIN_I2C_SCL)
#define I2C_SDA_LOW               (PORT_I2C_SDA->BRE  = PIN_I2C_SDA)
#define I2C_SDA_HIGH              (PORT_I2C_SDA->BSRE = PIN_I2C_SDA)

void IIC_Init(void);
void IIC_Start();
void IIC_Stop();
void IIC_Write_Byte(uchar txd);

#endif